﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using WpfCommonCtlTest.Views;

namespace WpfCommonCtlTest.ViewModels
{
    public partial class MainWindowViewModel : ObservableObject
    {
        private CameraView _cameraview;

        public MainWindowViewModel()
        {
        }

        [ObservableProperty]
        private UserControl mainView;

        [RelayCommand]
        public void ShowCamera()
        {
            if (_cameraview == null)
            {
                _cameraview = new CameraView();
            }
            MainView = _cameraview;
        }
    }
}